package com.dhy.cli.example;

import picocli.CommandLine;
import picocli.CommandLine.Option;

import java.util.concurrent.Callable;

public class Login  implements Callable<Integer> {
    @Option(names = {"-u", "--user"}, description = "User name")
    String user;

//    @Option(names = {"-p", "--password"}, description = "Password", interactive = true,echo = true)
    @Option(names = {"-p", "--password"}, description = "Password", interactive = true,echo = true,prompt = "Password:")
    String password;

    @Override
    public Integer call() throws Exception {
        System.out.println("password = " + password);
        return 0;
    }

    public static void main(String[] args) {
        new CommandLine(new Login()).execute("-u","user12","-p");
    }
}
